﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BW.MesProject.BasicData.Domain.基础;
using BW.MesProject.Public.ErrorCode;

namespace BW.MesProject.BasicData.Infrastructure
{
    //BOM实现那接口
    public interface IBomServices
    {
        /// <summary>
        /// 根据编码查询BOM
        /// </summary>
        /// <param name="bomCode">BOM编码</param>
        /// <returns>BOM数据列表</returns>
        ApiResult<List<Bommodel>> GetBomsByCode(string? bomCode);

        /// <summary>
        /// 获取BOM的子集列表
        /// </summary>
        /// <param name="id">父BOM ID</param>
        /// <returns>BOM子集列表</returns>
        ApiResult<List<Bommodel>> GetBomDetailWithChildren(long id);

        /// <summary>
        /// 添加BOM
        /// </summary>
        /// <param name="bommodel">BOM实体</param>
        /// <returns>操作结果</returns>
        ApiResult<bool> AddBom(Bommodel bommodel);

        /// <summary>
        /// 软删除BOM
        /// </summary>
        /// <param name="id">BOM ID</param>
        /// <returns>操作结果</returns>
        ApiResult<bool> SoftDeleteBom(long id);

        /// <summary>
        /// 添加子集BOM
        /// </summary>
        /// <param name="parentId">父级BOM ID</param>
        /// <param name="childBom">子集BOM实体</param>
        /// <returns>操作结果</returns>
        ApiResult<bool> AddChildBom(float parentId, Bommodel childBom);

        /// <summary>
        /// 更新BOM信息
        /// </summary>
        /// <param name="bommodel">BOM实体</param>
        /// <returns>操作结果</returns>
        ApiResult<bool> UpdateBom(Bommodel bommodel);
    }
}
